/*------------------------------------------------------------------------------
 * Copyright 2012 NCR Corporation
 *------------------------------------------------------------------------------
 * All revision information is updated automatically from source code control
 * change records - please do not manually edit.
 *------------------------------------------------------------------------------
 *
 * $LastChangedRevision:: 2123                                     $
 * $LastChangedBy:: rb250096                                       $
 * $LastChangedDate:: 2012-04-18 00:43:25 -0400 (Wed, 18 Apr 2012) $
 */

package com.ncr.nep.dashboardcore.utils.client;

import com.google.gwt.core.client.JavaScriptObject;

/**
 * Internal JavaScript overlay that is received by an
 * {@link InterWindowEventBus} when a new message is received from another
 * window/frame.
 *
 * @author rb250096
 * @version $Revision: 2123 $
 */
public class BusMessage extends JavaScriptObject {

    //--------------------------------------------------------------------------
    //
    //  Constructors
    //
    //--------------------------------------------------------------------------

    /**
     * Constructor
     */
    protected BusMessage() { }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    /**
     * Gets the type of message received.
     *
     * @return The message type.
     */
    public final native String getType() /*-{
        return this.type;
    }-*/;

    /**
     * Gets the ID of the underlying <code>WindowBus</code> instance that
     * send the message.
     *
     * @return The ID of the event bus that dispatched the message.
     */
    public final native String getSrc() /*-{
        return this.src;
    }-*/;

    /**
     * Gets object representing the payload of the message; this can be either
     * a JSON String of a {@link JavaScriptObject}.
     *
     * @return The message body.
     */
    public final native Object getBody() /*-{
        return this.body;
    }-*/;
}
